package chap6.homework13;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Random;

public class Task3 {
    public static void main(String[] args) throws Exception {
        BufferedReader buf=new BufferedReader(new FileReader("pan.txt"));
        ArrayList<String>arrayList=new ArrayList<String>();
        String line=null;
        Random random=new Random();
        while((line=buf.readLine())!=null){
            arrayList.add(line);
        }
        int a=random.nextInt(arrayList.size());
        String s=arrayList.get(a);
        System.out.println(s);
    }

}
